package com.flyduck.modules.system.mapper;

import com.flyduck.modules.system.domain.SysUser;
import com.github.pagehelper.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

@Mapper
public interface SysUserMapper {
    int deleteByPrimaryKey(@Param("id") Long id);

    int insert(SysUser record);

    int insertSelective(SysUser record);

    SysUser selectByPrimaryKey(@Param("id") Long id);

    int updateByPrimaryKeySelective(SysUser record);

    int updateByPrimaryKey(SysUser record);

    /**
     * 根据关键字分页查询
     * @param keyword
     * @return
     */
    Page<SysUser> findPage(@Param("keyword") String keyword);

    /**
     * 根据id更新用户状态
     * @param id
     * @param enabled
     */
    void updateStatus(@Param("id") Long id, @Param("enabled") Boolean enabled);

    /**
     * 根据用户名从数据库查用户信息
     * @param username
     * @return
     */
    SysUser findUserByUsername(@Param("username") String username);


}